<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script>
        // 1. 输入用户名 存入myname变量中
        var myname = prompt('请输入用户名');
        // 2. 弹出用户名
        alert(myname);
    </script>

</head>

<body>

</body>

</html>